<div navbar ng-init="currentItem='file'"></div>
<div ng-show="!loaded">
    <div loading></div>
</div>

<div id="main" ng-show="loaded" style="display:none">
    <div class="module-header">
        <h3>回收站管理</h3>
    </div>

    <div ng-init="tlist()">
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-6">
                <a class="btn btn-default btn-sm" href="#/file">
                    <span class="glyphicon glyphicon-chevron-left"></span> 返回文件管理
                </a>
                <button class="btn btn-danger btn-sm" ng-click="tcleanconfirm()">
                    <span class="glyphicon glyphicon-remove"></span> 清空回收站
                </button>
            </div>
            <!-- <div class="col-md-6 col-sm-6 col-xs-6" ng-show="items.length>0">
                <button class="btn btn-danger btn-sm pull-right" ng-click="tcleanconfirm()">
                    <span class="glyphicon glyphicon-remove"></span> 清空回收站
                </button>
                <a class="btn btn-default btn-sm pull-right" href="#/file">
                    <span class="glyphicon glyphicon-chevron-left"></span> 返回文件管理
                </a>
            </div> -->
        </div>

        <div style="margin-top: 10px;" ng-show="fileloading">
            <div waiting ng-init="waitingText='正在加载文件列表，请稍候...'"></div>
        </div>

        <!-- <div class="well" style="display:none;" ng-show="!fileloading && items.length==0">
            当前回收站是空的
        </div> -->
        <div class="panel panel-success" style="margin-top: 20px;" ng-show="!fileloading && items.length==0">
            <!-- <div class="panel-heading">
                <div class="panel-title">
                    <span class="glyphicon glyphicon-info-sign"> 当前回收站是空的</span>
                </div>
            </div> -->
            <div class="panel-body">
                <p>当前回收站是空的</p>
            </div>
        </div>

        <div ng-show="!fileloading && items.length>0" class="table-responsive" style="margin-top:10px;">
            <table class="table table-hover table-bordered table-condensed">
                <thead>
                    <tr>
                        <th>名称</th>
                        <th>原路径</th>
                        <th>删除时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in items">
                        <td>
                            <i class="glyphicon glyphicon-folder-open" title="文件夹" ng-show="item.isdir"></i>
                            <i class="glyphicon glyphicon-file" title="文件" ng-show="item.isreg"></i>
                            <i class="glyphicon glyphicon-link" title="链接" ng-show="item.islnk&&(item.link_isdir||item.link_isreg)"></i>
                            <i class="glyphicon glyphicon-ban-circle" title="未知" ng-show="!item.isdir&&!item.isreg&&(!item.islnk||(item.islnk&&!item.link_isdir&&!item.link_isreg))"></i> {{item.name}}
                        </td>
                        <td>{{item.path}}</td>
                        <td>{{item.time}}</td>
                        <td>
                            <button class="btn btn-primary btn-xs" ng-click="restore(item.mount, item.uuid)">还原文件</button>
                            <button class="btn btn-default btn-xs" ng-click="tdeleteconfirm(item.name, item.mount, item.uuid)">彻底删除</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<div id="confirm" class="modal fade">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 class="modal-title">{{confirm_title}}</h3>
            </div>
            <div class="modal-body" ng-bind-html-unsafe="confirm_body">
            </div>
            <div class="modal-footer">
                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">取消</button>
                <button class="btn btn-primary" onclick="$('#confirm').modal('hide')" ng-click="confirm()">确定</button>
            </div>
        </div>
    </div>
</div>